package com.wxy.demo.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

/**
 * <p>
 * 超时测试
 * </p>
 *
 * @author e-Xiaoyuan.Wang
 * @since 2023/2/6 10:53
 */
@RestController
@RequestMapping("timeout")
public class TimeOutController {


    /**
     * 模拟接口超时
     * @return
     * @throws InterruptedException
     */
    @GetMapping("demo1")
    public String demo1() throws InterruptedException {
        TimeUnit.SECONDS.sleep(1000);
        return "success";
    }
}
